import com.dst.dao.BookMapper;
import com.dst.dao.CategoryMapper;
import com.dst.entity.Book;
import com.dst.entity.Category;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class test {
    @Autowired
    private BookMapper bookMapper;
    @Autowired
    private CategoryMapper categoryMapper;
    @Test
    public void hh1(){
        List<Book> books = bookMapper.selectRecommend();
        books.forEach(System.out::println);
    }
    @Test
    public void hh2(){
        List<Book> books = bookMapper.selectJustIn();
        books.forEach(System.out::println);
    }
    @Test
    public void hh3(){
        List<Category> categories = categoryMapper.selectGrading();
        categories.forEach(System.out::println);
    }
    @Test
    public void hh4(){
        Book hh = bookMapper.selectByName("小妇人");
        System.out.println(hh);
    }
}
